package appinventor.ai_Ryan489.BBYM;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;

import android.widget.Button;
import android.widget.EditText;


public class HomeTab extends Activity {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		/* First Tab Content */
	
	      
		setContentView(R.layout.hometab);
		
	
	

		/* Second Tab Content */
		 
		
		
		    
		this.upgradeButton = (Button)this.findViewById(R.id.button1);
		  this.upgradeButton.setOnClickListener(new OnClickListener() {
		    public void onClick(View v) {
		    	
		      upgradeChecker();
		      
		    }
		  });
		  
	
	


		/* Second Tab Content */
	
}
	private Button upgradeButton;
	
	public void upgradeChecker()
	{
		EditText storenum;
    	storenum = (EditText) findViewById(R.id.storenum);
    	String storenumber = storenum.getText().toString();
		Intent upgradeIntent = new Intent("android.intent.action.VIEW", Uri.parse("https://upgradechecker-new.bestbuymobile.com/?storeid="+storenumber));
    	startActivity(upgradeIntent);
	}
}